from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import Unicode

from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.declarative import declarative_base

from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker

from zope.sqlalchemy import ZopeTransactionExtension

from sqlalchemy import Text

from sqlalchemy import Table, ForeignKey
from sqlalchemy.orm import relationship, backref

from scp.modelo.models import Base

from scp.modelo.Fase import Fase
from scp.modelo.Item import Item

__all__ = [ 'Linea_Base' ]




class Linea_Base(Base):
    """ The SQLAlchemy declarative model class for a Linea_Base object. """
    __tablename__ = 'linea_base'
    id = Column(Integer, primary_key=True)
    estado = Column(Text, nullable=False)
    fecha_creacion = Column(Text, nullable=False)
    nro_items = Column(Integer)
    flagBorrado = Column(Integer)
    
    fase_id = Column(Integer, ForeignKey('fase.id'))

    items = relationship("Item", backref="linea_base")
